/*****************************************************************
File name   : api_flash.h
Author      : liukaihua 
Version     : Ver1.0.0
Date        : 2022-04-21
Description : 关于flash的数据存储
Others      : 
History     : 
    1. Date:
       Author: ID:
       Modification:
    2. ...
*****************************************************************/

#ifndef __API_FLASH_H_
#define __API_FLASH_H_

#include "stdint.h"

/****************************************************************************/ 
#define FLASH_WRITE_ADDRESS1            0x000000 //按照sector擦除 每个sector是4KB
#define FLASH_READ_ADDRESS1             FLASH_WRITE_ADDRESS1

#define FLASH_WRITE_ADDRESS2            0x001000
#define FLASH_READ_ADDRESS2             FLASH_WRITE_ADDRESS2

#define FLASH_WRITE_ADDRESS3            0x002000
#define FLASH_READ_ADDRESS3             FLASH_WRITE_ADDRESS3

#define FLASH_WRITE_ADDRESS4            0x003000
#define FLASH_READ_ADDRESS4             FLASH_WRITE_ADDRESS4

#define FLASH_WRITE_ADDRESS5            0x004000
#define FLASH_READ_ADDRESS5             FLASH_WRITE_ADDRESS5

#define FLASH_WRITE_ADDRESS6            0x005000
#define FLASH_READ_ADDRESS6             FLASH_WRITE_ADDRESS6


void sta_Writeflash(void);// 
void sta_Readflash(void);
void temp_calib_Writeflash(void);
void temp_calib_Readflash(void);
void temp_set_en_Readflash(void);
void temp_set_en_Writeflash(void);
void AlarmCon_Writeflash(uint8_t sta);
void AlarmCon_Readflash(void);
void mode_Writeflash(void);
void mode_Readflash(void);
void my_Writeflash(uint32_t write_addr, uint8_t *savedata, uint16_t savelen);
void my_Readflash(uint32_t read_addr, uint8_t *readdata, uint16_t len);
void read_flash_all(void);
void AlarmCon_Ear_Writeflash(void);

#endif
/* [] END OF FILE */
